* lisp/minibuffer.el (completion--replace): Move point where it belongs
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 17 Oct 2010 17:30:22 +0000 (13:30 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 17 Oct 2010 17:30:22 +0000 (13:30 -0400)
when there's a common suffix.

lisp/ChangeLog
lisp/minibuffer.el

index a2d71ced5bc21f0043fc8200d6b587776f7481ef..6e7aadf29595d5c882198333965731b9dfe34569 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * minibuffer.el (completion--replace): Move point where it belongs
+       when there's a common suffix (bug#7215).
+
 2010-10-15  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp.el (tramp-open-connection-setup-interactive-shell):
index a4ab5261f7cdd30e84ae5f9ae2f028c293ae10c3..bc5a1d2e8071c114d10b74a044960a042c1e9810 100644 (file)
@@ -498,10 +498,11 @@ Moves point to the end of the new text."
       (setq suffix-len (1+ suffix-len)))
     (unless (zerop suffix-len)
       (setq end (- end suffix-len))
-      (setq newtext (substring newtext 0 (- suffix-len)))))
-  (goto-char beg)
-  (insert newtext)
-  (delete-region (point) (+ (point) (- end beg))))
+      (setq newtext (substring newtext 0 (- suffix-len))))
+    (goto-char beg)
+    (insert newtext)
+    (delete-region (point) (+ (point) (- end beg)))
+    (forward-char suffix-len)))
 
 (defun completion--do-completion (&optional try-completion-function)
   "Do the completion and return a summary of what happened.